/*
   Copyright (c) 2019 Shanghai Xuanzi Technology Co. Ltd https://xuanzi.ltd
   XZMindMap is licensed under the Mulan PSL v1.
   You can use this software according to the terms and conditions of the Mulan PSL v1.
   You may obtain a copy of Mulan PSL v1 at:
      http://license.coscl.org.cn/MulanPSL
   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
   PURPOSE.
   See the Mulan PSL v1 for more details.

*/

package xuanzi.openmind.nodes;
 
import xuanzi.commons.graphics.Canvas;
import xuanzi.commons.graphics.Paint;
import xuanzi.openmind.layout.Box;

public class Media extends Box{
	
	public final static int WEST = 0;
	public final static int NORTH = 1;
	public final static int SOUTH = 2;
	public final static int EAST = 3;
	public final static int NorthSpace = 4;
	public final static int SouthSpace = 5;
	int align;
	
	int color = 0xff000000;
	
	int fillColor = 0x0;

	
	public void setFillColor(int fillColor) {
		this.fillColor = fillColor;
	}
	
	public void setColor(int color) {
		this.color = color;
	}
	
	public Media() {
		// TODO Auto-generated constructor stub
		setMiniWidth(28);
		setMiniHeight(28);
	}
	
	protected Node node;
	
	public Node getNode() {
		return node;
	}
	
	public void setNode(Node node) {
		this.node = node;
	}
	
	public void setAlign(int align) {
		this.align = align;
	}
	
	public int getAlign() {
		return align;
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return getClass().getSimpleName();
	}
	
	public void onLayout(Box parent){
	//	parent.add(bound);
		 setEmpty();
		 union(18,18);
	//	parent.add(bound);
	}
	
	JSON data;
	 
	
	public Box getBound() {
		
		return this;
	}
	
	public JSON getData() {
		return data;
	}
	
	 public void setData(JSON data) {
		this.data = data;
	}
	
	protected Paint paint = new Paint();
	
	public void draw(Canvas canvas) { 
		paint.borderColor = 0x6600ff00;
		paint.borderSize = 2;
		paint.fill = false;
		canvas.drawRect(this, paint);
	}

}
